<html>
<head><meta charset="utf-8"><title>Salsa integration into rustc · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html">Salsa integration into rustc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219770714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219770714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Phil Ellison <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219770714">(Dec 13 2020 at 17:24)</a>:</h4>
<p>The Salsa docs state that they’re inspired by the rustc query system. Is there a plan, or even just a vague aspiration, to integrate Salsa into the compiler at some point? If so, is there a write up or discussion anywhere of what the main obstacles are to this beyond “just” doing a large scale code refactoring?</p>



<a name="219771013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771013">(Dec 13 2020 at 17:33)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> and <span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span> would know more about this than me, but there is definitely a vague plan to integrate it. I'm not sure how long that would take or how much work it would be, though.</p>



<a name="219771540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771540">(Dec 13 2020 at 17:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/Salsa.20integration.20into.20rustc/near/219771013">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> and <span class="user-mention silent" data-user-id="255061">Léo Lanteri Thauvin</span> would know more about this than me, but there is definitely a vague plan to integrate it. I'm not sure how long that would take or how much work it would be, though.</p>
</blockquote>
<p>There has to be a mistake here, I had never heard of salsa before <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="219771553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771553">(Dec 13 2020 at 17:47)</a>:</h4>
<p>oh, I was just confused because you opened <a href="https://github.com/rust-lang/rust/pull/79169">https://github.com/rust-lang/rust/pull/79169</a> then</p>



<a name="219771592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771592">(Dec 13 2020 at 17:48)</a>:</h4>
<p>salsa is not chalk fwiw</p>



<a name="219771598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771598">(Dec 13 2020 at 17:48)</a>:</h4>
<p>I expect any salsa integration to be mostly unrelated to chalk work, even</p>



<a name="219771609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771609">(Dec 13 2020 at 17:49)</a>:</h4>
<p>that explains my confusion <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> sorry for the bad info</p>



<a name="219771623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771623">(Dec 13 2020 at 17:49)</a>:</h4>
<p>No worries <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="219771846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219771846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219771846">(Dec 13 2020 at 17:54)</a>:</h4>
<p>I can't find anything related to salsa in the <code>rust-lang/compiler-team</code> repo, the closest thing I see is <a href="https://github.com/rust-lang/compiler-team/issues/388">compiler-team#388</a></p>



<a name="219772348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Phil Ellison <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772348">(Dec 13 2020 at 18:06)</a>:</h4>
<p>Thanks for the repo link - I hadn’t thought to look there (not that it appears to give a definitive answer in this case).</p>



<a name="219772463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772463">(Dec 13 2020 at 18:09)</a>:</h4>
<p>I'd guess that means there is no plan currently to integrate salsa in rustc, at least in the short term</p>



<a name="219772651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772651">(Dec 13 2020 at 18:13)</a>:</h4>
<p>There's a mention of salsa in <a href="https://smallcultfollowing.com/babysteps/blog/2020/04/09/libraryification/#the-first-trend-on-demand-analysis">this blog post by <span class="user-mention silent" data-user-id="116009">nikomatsakis</span></a> too</p>
<blockquote>
<p>The rust-analyzer project is based entirely on on-demand computation, using the salsa library.</p>
</blockquote>



<a name="219772789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772789">(Dec 13 2020 at 18:17)</a>:</h4>
<p>I'm not even aware of any long-term plans, besides some vague "wouldn't it be neat to do this" feelings</p>



<a name="219772792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772792">(Dec 13 2020 at 18:17)</a>:</h4>
<p>from what I know us integrating salsa to replace the current query infrastructure is fairly unlikely in the near future</p>



<a name="219772846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772846">(Dec 13 2020 at 18:18)</a>:</h4>
<p>Salsa would have to gain support for parallelization inside queries, or rustc would lose that feature</p>



<a name="219772853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772853">(Dec 13 2020 at 18:18)</a>:</h4>
<p>Not that it's on by default, but a lot of work went into it</p>



<a name="219772859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219772859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219772859">(Dec 13 2020 at 18:18)</a>:</h4>
<p>though i am also not really involved with salsa, so you would probably need to ask <span class="user-mention" data-user-id="116009">@nikomatsakis</span> or <span class="user-mention" data-user-id="116113">@lqd</span> for a more definitive answer</p>



<a name="219774561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219774561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Phil Ellison <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219774561">(Dec 13 2020 at 18:58)</a>:</h4>
<p>Thanks for the information, in particular on the difference with respect to intra-query parallelisation, which I wasn’t aware of.</p>



<a name="219776553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219776553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219776553">(Dec 13 2020 at 19:31)</a>:</h4>
<p>I'm not really involved with salsa either :) it is definitely used both in chalk, and rust-analyzer (and <span class="user-mention silent" data-user-id="133169">matklad</span> is one of salsa's authors with Niko)</p>



<a name="219776644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219776644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219776644">(Dec 13 2020 at 19:33)</a>:</h4>
<p>maybe <span class="user-mention silent" data-user-id="133169">matklad</span> has thoughts about this but as Jonas said, they're not exactly equivalent today</p>



<a name="219779642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219779642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219779642">(Dec 13 2020 at 20:27)</a>:</h4>
<p>Most of what has been said above is correct. Any plans as far as salsa integration are mostly out of wg-traits purview. Salsa is currently using in Chalk, but only in the test harness. There are some thoughts on integrating it as part of the recursive crate, but that's orthogonal. It's also used in rust-analyzer, but I don't really know much. Definitely <span class="user-mention" data-user-id="133169">@matklad</span> and <span class="user-mention" data-user-id="116009">@nikomatsakis</span> would know more about any potential future plans. (There's also a separate Salsa zulip, but I don't remember it)</p>



<a name="219780118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219780118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219780118">(Dec 13 2020 at 20:37)</a>:</h4>
<p>(<a href="https://salsa.zulipchat.com">https://salsa.zulipchat.com</a>)</p>



<a name="219811362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219811362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219811362">(Dec 14 2020 at 08:28)</a>:</h4>
<p>There are no short/medium plans here. The two query systems just to different at the moment. For example, rustc's one is geared towards on-disc persistance &amp; incrmental compilation, while salsa is strictly in-memory and is primarily about laziness</p>



<a name="219846890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Salsa%20integration%20into%20rustc/near/219846890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Salsa.20integration.20into.20rustc.html#219846890">(Dec 14 2020 at 14:21)</a>:</h4>
<p>Yeah, I'd like to see them unified, but it's low on my list of priorities.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>